package com.example.work4.http.imp

import com.example.work4.http.body.CommentSaveBody
import com.example.work4.http.body.MomentSaveBody
import com.example.work4.http.body.MomentSelectBody
import com.example.work4.http.data.MomentPageData
import com.example.work4.po.Comment
import com.example.work4.po.Moments
import com.example.work4.po.ResultBean
import retrofit2.Call
import retrofit2.http.*

interface MomentRetrofit {

    @POST("/api/moment/getFriendsMoments")
    fun getMoments(
        @Header("Authorization") token:String,
        @Body body: MomentSelectBody
    ): Call<ResultBean<MomentPageData>>


    @POST("/api/moment/getMyMoments")
    fun getMyMoments(
        @Header("Authorization") token:String,
    ): Call<ResultBean<List<Moments>>>

    @POST("/api/moment/save")
    fun saveMoment(
        @Header("Authorization") token:String,
        @Body body: MomentSaveBody
    ): Call<ResultBean<Void>>

    @POST("/api/moment/addComment")
    fun addComment(
        @Header("Authorization") token:String,
        @Body body: CommentSaveBody
    ): Call<ResultBean<Void>>

    @POST("/api/moment/getMomentsById")
    fun getMomentsById(
        @Header("Authorization") token:String,
        @Body body: MomentSelectBody
    ): Call<ResultBean<MomentPageData>>

    @GET("/api/moment/queryCommentByMomentId")
    fun queryCommentByMomentId(
        @Header("Authorization") token:String,
        @Query("id") id: Long
    ): Call<ResultBean<List<Comment>>>

    @GET("/api/moment/queryMomentsInDis")
    fun queryMomentsInDis(
        @Header("Authorization") token:String,
        @Query("lon") lon: Double,
        @Query("lat") lat: Double,
        @Query("distance") distance: Double
    ): Call<ResultBean<MomentPageData>>
}